<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <title>Stream — Space.js</title>

    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto+Mono">
    <link rel="stylesheet" href="assets/css/style.css">

    <script type="module">
        import { WebAudio } from '../src/index.js';

        WebAudio.init({ sampleRate: 48000 });

        // Shoutcast streams append a semicolon (;) to the URL
        WebAudio.load({ protonradio: 'https://shoutcast.protonradio.com/;' });

        const protonradio = WebAudio.get('protonradio');
        protonradio.gain.set(1);

        document.addEventListener('pointerdown', () => {
            protonradio.play();
        });
    </script>
</head>
<body>
</body>
</html>
